// import { cloud } from '@/framework/utils/request'
// 表单属性【右面板】
export const formConf = {
  formRef: 'elForm',
  tableCode: '',
  formModel: 'formData',
  size: 'medium',
  labelPosition: 'right',
  labelWidth: 100,
  formRules: 'rules',
  gutter: 0,
  disabled: false,
  span: 24,
  formBtns: true
}

// 输入型组件 【左面板】
export const inputComponents = [
  {
    // 组件的自定义配置
    __config__: {
      label: '单行文本',
      labelWidth: null,
      showLabel: true,
      changeTag: true,
      tag: 'el-input',
      tagIcon: 'input',
      icon: 'Language',
      defaultValue: undefined,
      required: false,
      layout: 'colFormItem',
      span: 24,
      document: 'https://element.eleme.cn/#/zh-CN/component/input',
      // 正则校验规则
      regList: [],
      isFromTable: true,
      tableColumnType: 'input'
    },
    // 组件的插槽属性
    __slot__: {
      prepend: '',
      append: ''
    },
    // 其余的为可直接写在组件标签上的属性
    placeholder: '请输入',
    style: { width: '100%' },
    clearable: true,
    'prefix-icon': '',
    'suffix-icon': '',
    maxlength: 30,
    'show-word-limit': false,
    readonly: false,
    disabled: false,
    show: true,
    tagType: 'text',
    isModelDisable: false,
    modelType: '字符串'
  },
  {
    __config__: {
      label: '多行文本',
      labelWidth: null,
      showLabel: true,
      tag: 'el-input',
      tagIcon: 'textarea',
      icon: 'tickets',
      defaultValue: undefined,
      required: false,
      layout: 'colFormItem',
      span: 24,
      regList: [],
      changeTag: true,
      isFromTable: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/input',
      tableColumnType: 'textarea'
    },
    type: 'textarea',
    placeholder: '请输入',
    autosize: {
      minRows: 4,
      maxRows: 4
    },
    style: { width: '100%' },
    maxlength: 30,
    'show-word-limit': false,
    readonly: false,
    disabled: false,
    show: true,
    tagType: 'text',
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '密码',
      showLabel: true,
      labelWidth: null,
      changeTag: true,
      tag: 'el-input',
      tagIcon: 'password',
      icon: 'key',
      defaultValue: undefined,
      layout: 'colFormItem',
      span: 24,
      required: false,
      isFromTable: true,
      regList: [],
      document: 'https://element.eleme.cn/#/zh-CN/component/input',
      tableColumnType: 'password'
    },
    __slot__: {
      prepend: '',
      append: ''
    },
    placeholder: '请输入',
    'show-password': true,
    style: { width: '100%' },
    clearable: true,
    'prefix-icon': '',
    'suffix-icon': '',
    maxlength: 30,
    // 'show-word-limit': false,
    readonly: false,
    disabled: false,
    show: true,
    tagType: 'text',
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '计数器',
      showLabel: true,
      changeTag: true,
      labelWidth: null,
      tag: 'el-input-number',
      tagIcon: 'number',
      icon: 'timer',

      defaultValue: 0,
      span: 24,
      layout: 'colFormItem',
      required: false,
      isFromTable: true,
      regList: [],
      document: 'https://element.eleme.cn/#/zh-CN/component/input-number',
      tableColumnType: 'number'
    },
    placeholder: '',
    min: undefined,
    max: undefined,
    step: 1,
    'step-strictly': false,
    precision: undefined,
    'controls-position': '',
    disabled: false,
    show: true,
    tagType: 'number',
    isModelDisable: false,
    modelType: '数字'

  },
  {
    __config__: {
      label: '编辑器',
      showLabel: true,
      changeTag: true,
      labelWidth: null,
      tag: 'dt-tinymce',
      tagIcon: 'rich-text',
      icon: 'edit',
      defaultValue: null,
      span: 24,
      layout: 'colFormItem',
      required: false,
      isFromTable: true,
      regList: [],
      document: 'http://tinymce.ax-z.cn',
      tableColumnType: 'rich-text'
    },
    disabled: false,
    show: true,
    isDefaultValueShow: false,
    // placeholder: '请输入',
    height: 300, // 编辑器高度
    // branding: false // 隐藏右下角品牌烙印
    isModelDisable: false,
    modelType: '字符串'

  }
]

// 选择型组件 【左面板】
export const selectComponents = [
  {
    __config__: {
      label: '下拉选择',
      showLabel: true,
      labelWidth: null,
      tag: 'el-select',
      tagIcon: 'select',
      icon: 'arrow-down',
      layout: 'colFormItem',
      dataType: 'static',
      span: 24,
      required: false,
      regList: [],
      isFromTable: true,
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/select',
      tableColumnType: 'select',
      method: 'get'
    },
    __slot__: {
      options: [{
        label: '选项一',
        value: '1'
      }, {
        label: '选项二',
        value: '2'
      }]
    },
    placeholder: '请选择',
    style: { width: '100%' },
    clearable: true,
    disabled: false,
    show: true,
    filterable: false,
    multiple: false,
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '级联选择',
      url: '',
      // url: 'http://192.168.100.172:30377/stage-api/project/sysProcessCategory/list',
      // url: 'https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/cascaderList',
      method: 'get',
      dataPath: 'data',
      dataConsumer: 'options',
      showLabel: true,
      labelWidth: null,
      tag: 'el-cascader',
      tagIcon: 'cascader',
      icon: 'd-arrow-right',

      layout: 'colFormItem',
      defaultValue: [],
      dataType: 'dynamic',
      span: 24,
      required: false,
      regList: [],
      isFromTable: true,
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/cascader',
      tableColumnType: 'cascader'

    },
    options: [{
      id: 1,
      value: '1',
      label: '选项1',
      children: [{
        id: 2,
        value: '2',
        label: '选项1-1'
      }]
    }],
    placeholder: '请选择',
    style: { width: '100%' },
    props: {
      props: {
        multiple: false,
        label: 'label',
        value: 'value',
        children: 'children'
      }
    },
    'show-all-levels': true,
    disabled: false,
    show: true,
    clearable: true,
    filterable: false,
    separator: '/',
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '单选框组',
      labelWidth: null,
      showLabel: true,
      tag: 'el-radio-group',
      tagIcon: 'radio',
      icon: 'circle-check',
      changeTag: true,
      defaultValue: undefined,
      layout: 'colFormItem',
      dataType: 'static',
      span: 24,
      optionType: 'default',
      isFromTable: true,
      regList: [],
      required: false,
      // border: false,
      document: 'https://element.eleme.cn/#/zh-CN/component/radio',
      tableColumnType: 'radio'

    },
    __slot__: {
      options: [{
        label: '选项一',
        value: '1'
      }, {
        label: '选项二',
        value: '2'
      }]
    },
    style: {},
    size: 'medium',
    disabled: false,
    show: true,
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '多选框组',
      tag: 'el-checkbox-group',
      tagIcon: 'checkbox',
      icon: 'Checkbox',
      defaultValue: [],
      span: 24,
      showLabel: true,
      labelWidth: null,
      layout: 'colFormItem',
      optionType: 'default',
      dataType: 'static',
      required: false,
      regList: [],
      changeTag: true,
      isFromTable: true,
      // border: false,
      document: 'https://element.eleme.cn/#/zh-CN/component/checkbox',
      tableColumnType: 'checkbox'
    },
    __slot__: {
      options: [{
        label: '选项一',
        value: '1'
      }, {
        label: '选项二',
        value: '2'
      }]
    },
    style: {},
    size: 'medium',
    min: 0,
    max: 1000,
    disabled: false,
    show: true,
    isModelDisable: false,
    modelType: '字符串'

  },
  // {
  //   __config__: {
  //     label: '开关',
  //     tag: 'el-switch',
  //     tagIcon: 'switch',
  //     icon: 'open',
  //     defaultValue: false,
  //     span: 24,
  //     showLabel: true,
  //     labelWidth: null,
  //     layout: 'colFormItem',
  //     required: false,
  //     regList: [],
  //     isFromTable: true,
  //     changeTag: true,
  //     document: 'https://element.eleme.cn/#/zh-CN/component/switch',
  //     tableColumnType: 'switch'
  //   },
  //   style: {},
  //   disabled: false,
  //   show: true,
  //   'active-text': '',
  //   'inactive-text': '',
  //   'active-color': null,
  //   'inactive-color': null,
  //   'active-value': true,
  //   'inactive-value': false,
  //   isModelDisable: false,
  //   modelType: '字符串'

  // },
  // {
  //   __config__: {
  //     label: '滑块',
  //     tag: 'el-slider',
  //     tagIcon: 'slider',
  // icon:'operation',
  //     defaultValue: 0,
  //     span: 24,
  //     showLabel: true,
  //     layout: 'colFormItem',
  //     labelWidth: null,
  //     // required: false,
  //     isFromTable: true,
  //     regList: [],
  //     changeTag: true,
  //     document: 'https://element.eleme.cn/#/zh-CN/component/slider',
  //     tableColumnType: 'slider'
  //   },
  //   disabled: false,
  //   min: 0,
  //   max: 100,
  //   step: 1,
  //   'show-stops': false,
  //   range: false,
  //   isModelDisable: false

  // },
  {
    __config__: {
      label: '时间选择',
      tag: 'el-time-picker',
      tagIcon: 'time',
      icon: 'alarm-clock',
      defaultValue: null,
      span: 24,
      showLabel: true,
      layout: 'colFormItem',
      labelWidth: null,
      required: false,
      regList: [],
      isFromTable: true,
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/time-picker',
      tableColumnType: 'time'
    },
    placeholder: '请选择',
    style: { width: '100%' },
    disabled: false,
    show: true,
    clearable: true,
    'picker-options': {
      selectableRange: '00:00:00-23:59:59'
    },
    isDefaultValueShow: false,
    format: 'HH:mm:ss',
    'value-format': 'HH:mm:ss',
    isModelDisable: false,
    modelType: '日期'

  },
  {
    __config__: {
      label: '时间范围',
      tag: 'el-time-picker',
      tagIcon: 'time-range',
      icon: 'alarm-clock',
      span: 24,
      showLabel: true,
      labelWidth: null,
      layout: 'colFormItem',
      defaultValue: null,
      required: false,
      isFromTable: true,
      regList: [],
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/time-picker',
      tableColumnType: 'time-range'
    },
    style: { width: '100%' },
    disabled: false,
    show: true,
    isDefaultValueShow: false,
    clearable: true,
    'is-range': true,
    'range-separator': '至',
    'start-placeholder': '开始时间',
    'end-placeholder': '结束时间',
    format: 'HH:mm:ss',
    'value-format': 'HH:mm:ss',
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '日期选择',
      tag: 'el-date-picker',
      tagIcon: 'date',
      icon: 'calendar',
      defaultValue: null,
      showLabel: true,
      labelWidth: null,
      span: 24,
      layout: 'colFormItem',
      required: false,
      regList: [],
      isFromTable: true,
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/date-picker',
      tableColumnType: 'date'

    },
    isDefaultValueShow: false,
    placeholder: '请选择',
    type: 'date',
    style: { width: '100%' },
    disabled: false,
    show: true,
    clearable: true,
    format: 'yyyy-MM-dd',
    'value-format': 'yyyy-MM-dd',
    readonly: false,
    tagType: 'date',
    isModelDisable: false,
    modelType: '日期'

  },
  {
    __config__: {
      label: '日期范围',
      tag: 'el-date-picker',
      tagIcon: 'date-range',
      icon: 'calendar',
      defaultValue: [],
      span: 24,
      showLabel: true,
      labelWidth: null,
      required: false,
      isFromTable: true,
      layout: 'colFormItem',
      regList: [],
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/date-picker',
      tableColumnType: 'date-range'

    },
    style: { width: '100%' },
    type: 'daterange',
    'range-separator': '至',
    'start-placeholder': '开始日期',
    'end-placeholder': '结束日期',
    disabled: false,
    show: true,
    clearable: true,
    format: 'yyyy-MM-dd',
    'value-format': 'yyyy-MM-dd',
    isDefaultValueShow: false,
    readonly: false,
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '评分',
      tag: 'el-rate',
      tagIcon: 'rate',
      icon: 'star',
      defaultValue: 0,
      span: 24,
      showLabel: true,
      labelWidth: null,
      layout: 'colFormItem',
      // required: false,
      regList: [],
      isFromTable: true,
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/rate',
      tableColumnType: 'rate'

    },
    style: {},
    max: 5,
    'allow-half': false,
    // 'show-text': false,
    'show-score': false,
    disabled: false,
    show: true,
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '颜色选择',
      tag: 'el-color-picker',
      tagIcon: 'color',
      icon: 'brush',
      span: 24,
      defaultValue: null,
      showLabel: true,
      labelWidth: null,
      layout: 'colFormItem',
      required: false,
      isFromTable: true,
      regList: [],
      changeTag: true,
      document: 'https://element.eleme.cn/#/zh-CN/component/color-picker',
      tableColumnType: 'color'
    },
    'show-alpha': false,
    'color-format': '',
    disabled: false,
    show: true,
    size: 'medium',
    isModelDisable: false,
    modelType: '字符串'

  },
  // {
  //   __config__: {
  //     label: '上传',
  //     tag: 'el-upload',
  //     tagIcon: 'upload',
  // icon:'folder',
  //     layout: 'colFormItem',
  //     defaultValue: null,
  //     showLabel: true,
  //     labelWidth: null,
  //     required: false,
  //     span: 24,
  //     showTip: false,
  //     buttonText: '点击上传',
  //     regList: [],
  //     changeTag: true,
  //     fileSize: 2,
  //     sizeUnit: 'MB',
  //     document: 'https://element.eleme.cn/#/zh-CN/component/upload'
  //   },
  //   __slot__: {
  //     'list-type': true
  //   },
  //   action: process.env.VUE_APP_BASE_API + cloud.file + '/sysFileInfo/upload', // 上传地址，必填,
  //   disabled: false,
  //   accept: '',
  //   name: 'file',
  //   isDefaultValueShow:false,
  //   'auto-upload': true,
  //   'list-type': 'text',
  //   multiple: false
  // },
  {
    __config__: {
      label: '文件上传',
      tag: 'dt-fileUpload',
      tagIcon: 'fileupload',
      icon: 'folder',
      layout: 'colFormItem',
      defaultValue: null,
      showLabel: true,
      labelWidth: null,
      required: false,
      // isFromTable: true,
      span: 24,
      // showTip: false,
      // buttonText: '点击上传',
      regList: [],
      changeTag: true,

      sizeUnit: 'MB',
      document: 'https://element.eleme.cn/#/zh-CN/component/upload',
      tableColumnType: 'fileupload'
    },
    __slot__: {
      'list-type': true
    },
    // action: process.env.VUE_APP_BASE_API + cloud.file + '/sysFileInfo/upload', // 上传地址，必填,
    disabled: false,
    show: true,
    fileSize: 5,
    // accept: '',
    name: 'file',
    isDefaultValueShow: false,
    // 'auto-upload': true,
    // 'list-type': 'text',
    multiple: false,
    isModelDisable: false,
    modelType: '字符串'

  },
  {
    __config__: {
      label: '图片上传',
      tag: 'dt-upload',
      tagIcon: 'dt-upload',
      icon: 'picture',
      layout: 'colFormItem',
      defaultValue: null,
      showLabel: true,
      // isFromTable: true,
      labelWidth: null,
      required: false,
      span: 24,

      // showTip: false,
      // buttonText: '点击上传',
      regList: [],
      changeTag: true,

      sizeUnit: 'MB',
      // document: 'https://element.eleme.cn/#/zh-CN/component/upload',
      tableColumnType: 'dt-upload'

    },
    __slot__: {
      'list-type': true
    },
    // action: 'https://jsonplaceholder.typicode.com/posts/',
    disabled: false,
    show: true,
    fileSize: 5,
    isDefaultValueShow: false,
    // accept: '',
    // name: 'imageUpload',
    // 'auto-upload': true,
    'list-type': 'picture-card',
    // fileLimit: 1, // rightpanel    render中处理的
    multiple: false,
    isModelDisable: false,
    modelType: '字符串'

  }
]

// 布局型组件 【左面板】
export const layoutComponents = [
  {
    __config__: {
      layout: 'rowFormItem',
      tagIcon: 'row',
      icon: 'center-vertically',
      label: '行容器',
      layoutTree: true,
      tableColumnType: 'row',
      document: 'https://element.eleme.cn/#/zh-CN/component/layout#row-attributes'
    },
    type: 'default',
    justify: 'start',
    align: 'top',
    isModelDisable: false

  },
  //  {
  //   __config__: {
  //     layout: 'dtTableRender',
  //     tagIcon: 'dt-table',
  //     tag: 'dt-table',
  //     label: '从表',
  //     children: [
  //       {
  //         '__config__': {
  //           'label': '单行文本',
  //           'labelWidth': null,
  //           'showLabel': true,
  //           'changeTag': true,
  //           'tag': 'el-input',
  //           'tagIcon': 'input',
  //           'required': true,
  //           'layout': 'colFormItem',
  //           'span': 24,
  //           'document': 'https://element.eleme.cn/#/zh-CN/component/input',
  //           'regList': [],
  //           'formId': 105,
  //           'renderKey': '1051692086657441'
  //         },
  //         '__slot__': {
  //           'prepend': '',
  //           'append': ''
  //         },
  //         'placeholder': '请输入单行文本',
  //         'style': {
  //           'width': '100%'
  //         },
  //         'clearable': true,
  //         'prefix-icon': '',
  //         'suffix-icon': '',
  //         'maxlength': 30,
  //         'show-word-limit': false,
  //         'readonly': false,
  //         'disabled': false,
  //         '__vModel__': 'field105'
  //       }
  //     ],
  //     tableOpts: {
  //       tableData: [],
  //       tableCol: []
  //     },
  //     dialogVisible: false,
  //     span: 24,
  //     layoutTree: true,
  //     document: 'https://element.eleme.cn/#/zh-CN/component/layout#row-attributes'
  //   },
  //   type: 'default',
  //   justify: 'start',
  //   align: 'top'
  // },
  {
    __config__: {
      layout: 'dtTableDialogRender',
      tagIcon: 'dt-table',
      icon: 'document-copys',
      tag: 'dt-table',
      componentName: '从表1',

      orderNumber: true,
      label: '从表',
      children: [
      ],
      tableOpts: {
        tableData: [],
        tableCol: [],
        indexTableCol: {
          label: '序号',
          width: 70,
          index: true
        }
      },
      dialogVisible: false,
      span: 24,
      layoutTree: true,
      tableColumnType: 'dt-table',
      document: 'https://element.eleme.cn/#/zh-CN/component/layout#row-attributes'
    },
    tableName: '',
    type: 'default',
    justify: 'start',
    align: 'top',
    isModelDisable: false

  }
  // {
  //   __config__: {
  //     label: '按钮',
  //     showLabel: true,
  //     changeTag: false,
  //     labelWidth: null,
  //     tag: 'el-button',
  //     tagIcon: 'button',
  //     span: 24,
  //     layout: 'colFormItem',
  //     document: 'https://element.eleme.cn/#/zh-CN/component/button'
  //   },
  //   __slot__: {
  //     default: '主要按钮'
  //   },
  //   type: 'primary',
  //   icon: 'el-icon-search',
  //   round: false,
  //   size: 'medium',
  //   plain: false,
  //   circle: false,
  //   disabled: false,
  //   isDefaultValueShow: false
  // }
  // {
  //   __config__: {
  //     layout: 'colFormItem',
  //     tagIcon: 'table',
  //     tag: 'el-table',
  //     document: 'https://element.eleme.cn/#/zh-CN/component/table',
  //     span: 24,
  //     formId: 101,
  //     renderKey: 1595761764203,
  //     componentName: 'row101',
  //     showLabel: true,
  //     changeTag: true,
  //     labelWidth: null,
  //     label: '表格[开发中]',
  //     dataType: 'dynamic',
  //     method: 'get',
  //     dataPath: 'list',
  //     dataConsumer: 'data',
  //     url: 'https://www.fastmock.site/mock/f8d7a54fb1e60561e2f720d5a810009d/fg/tableData',
  //     children: [{
  //       __config__: {
  //         layout: 'raw',
  //         tag: 'el-table-column',
  //         renderKey: 15957617660153
  //       },
  //       prop: 'date',
  //       label: '日期'
  //     }, {
  //       __config__: {
  //         layout: 'raw',
  //         tag: 'el-table-column',
  //         renderKey: 15957617660152
  //       },
  //       prop: 'address',
  //       label: '地址'
  //     }, {
  //       __config__: {
  //         layout: 'raw',
  //         tag: 'el-table-column',
  //         renderKey: 15957617660151
  //       },
  //       prop: 'name',
  //       label: '名称'
  //     }, {
  //       __config__: {
  //         layout: 'raw',
  //         tag: 'el-table-column',
  //         renderKey: 1595774496335,
  //         children: [
  //           {
  //             __config__: {
  //               label: '按钮',
  //               tag: 'el-button',
  //               tagIcon: 'button',
  //               layout: 'raw',
  //               renderKey: 1595779809901
  //             },
  //             __slot__: {
  //               default: '主要按钮'
  //             },
  //             type: 'primary',
  //             icon: 'el-icon-search',
  //             round: false,
  //             size: 'medium'
  //           }
  //         ]
  //       },
  //       label: '操作'
  //     }]
  //   },
  //   data: [],
  //   directives: [{
  //     name: 'loading',
  //     value: true
  //   }],
  //   border: true,
  //   type: 'default',
  //   justify: 'start',
  //   align: 'top'
  // }

  // {
  //   __config__: {
  //     label: '饼图',
  //     showLabel: true,
  //     changeTag: false,
  //     labelWidth: null,
  //     tag: 'pie-chart',
  //     tagIcon: 'button',
  //     span: 24,
  //     layout: 'colFormItem',
  //     document: 'https://element.eleme.cn/#/zh-CN/component/button'
  //   },
  //   __slot__: {
  //     default: '主要按钮'
  //   },
  //   type: 'primary',
  //   icon: 'el-icon-search',
  //   round: false,
  //   size: 'medium',
  //   plain: false,
  //   circle: false,
  //   disabled: false,
  //   isDefaultValueShow: false
  // }
]

